
#define	PROMPT		":> "

#define	MAXARGS		15

#define forever while(1)

#define	STRLIST 	"listar"
#define	STRRSVR		"reservar"
#define STROCUP		"ocupar"
#define	STRFREE		"liberar"
#define STRQUIT		"salir"
#define	STRHELP		"ayuda"


/* Possible commands */
enum
{
	EHELP = 1, EFREE, EOCUP, ERSVR, ELIST, EQUIT
};

/**
 ** Prints a prompt line and gets input.
 **
 **	@param	prompt	Prompt string.
 **	@param	inpbuf	The line is left here.
 **	@return			Returns the size of the line.
 **
 **/
int input(char * prompt, char * inpbuf);

/**
 ** Processes the line and separates it into arguments.
 **
 **	@param	line	The line that needs to be processed.
 **	@return			Returns 1 if succesful or 0 if an error ocurred.
 **
 **/
int process_line(char * line);

/**
 **	Processes the the command, and if any matches, calls the function to run it.
 **
 **	@param	argc	Number of arguments.
 **	@param	argv	Pointer to the array of char * with the arguments.
 **	@return			Returns the code of the matched command, or 0 if none did
 **					match.
 **
 **/
int process_command(int argc, char * argv[]);


/**
 **	Frees the arguments previously allocated.
 **
 **	@param	arg		Pointer to the array of char * with the arguments.
 **	@param	narg	Number of arguments.
 **
 **/
void freeArg(char ** arg, int narg);

/**
 ** Checks if the line contains no invalid characters and is well-formed.
 **
 **	@param	line	The line to be checked.
 ** @return			Returns 1 if OK, 0 if not.
 **
 **/
int checkLine(char * line);
